package vista;
import java.awt.BorderLayout;
import java.awt.Image;
import java.awt.event.ActionListener;

import bean.JPanelIcon;

import javax.swing.BorderFactory;
import javax.swing.DebugGraphics;
import javax.swing.ImageIcon;
import javax.swing.JFormattedTextField;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
import javax.swing.JTextField;

import javax.swing.WindowConstants;
import javax.swing.border.LineBorder;
import javax.swing.SwingUtilities;

import bean.BtSacfre;
import bean.TxtEscribirLetrasEspaciosNumeros;
import bean.TxtEscribirLetrasNumeros;


/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class frmInicio extends javax.swing.JFrame {
	private JPanel pndatos;
	private JPanel pninicio;
	private JPasswordField ptpassword;
	private JLabel lblpassword;
	private JPanelIcon pnimagen;
	private TxtEscribirLetrasEspaciosNumeros txtid;
	private JLabel lblid;
	private BtSacfre btentrar;
	private BtSacfre btcancelar;
	private JOptionPane mensaje;

	/**
	* Auto-generated main method to display this JFrame
	*/
	public static void main(String[] args) {
		SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				frmInicio inst = new frmInicio();
				inst.setLocationRelativeTo(null);
				inst.setVisible(true);
			}
		});
	}
	
	public frmInicio() {
		super();
		initGUI();
	}
	
	private void initGUI() {
		try {
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			this.setTitle("SACFRE/Login");
			this.setResizable(false);
			{
				pndatos = new JPanel();
				getContentPane().add(pndatos, BorderLayout.CENTER);
				pndatos.setPreferredSize(new java.awt.Dimension(806, 415));
				pndatos.setBackground(new java.awt.Color(239,171,183));
				pndatos.setLayout(null);
				{
					pninicio = new JPanel();
					pndatos.add(pninicio);
					pninicio.setLayout(null);
					pninicio.setBounds(15, 17, 783, 382);
					pninicio.setBackground(new java.awt.Color(255,219,225));
					pninicio.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false));
					{
						lblid = new JLabel();
						pninicio.add(lblid);
						lblid.setText("Id:");
						lblid.setBounds(226, 237, 23, 27);
						lblid.setFont(new java.awt.Font("FreeSerif",1,16));
					}
					{
						txtid = new TxtEscribirLetrasEspaciosNumeros();
						pninicio.add(txtid);
						txtid.setBounds(252, 231, 312, 35);
					}
					{
						lblpassword = new JLabel();
						pninicio.add(lblpassword);
						lblpassword.setText("Password:");
						lblpassword.setBounds(162, 280, 87, 24);
						lblpassword.setFont(new java.awt.Font("FreeSerif",1,16));
					}
					{

						btcancelar= new BtSacfre();
						pninicio.add(btcancelar);
						btcancelar.setText("Cancelar");
						btcancelar.setBounds(414, 325, 147, 39);
						btcancelar.setIcon(new ImageIcon(getClass().getClassLoader().getResource("Iconos/delete3.png")));
					}
					{
						btentrar = new BtSacfre();
						pninicio.add(btentrar);
						btentrar.setText("Entrar");
						btentrar.setBounds(257, 325, 148, 39);
						btentrar.setIcon(new ImageIcon(getClass().getClassLoader().getResource("Iconos/next.png")));
					}
					{
						ptpassword = new JPasswordField();
						pninicio.add(ptpassword);
						ptpassword.setBounds(254, 278, 310, 35);
						ptpassword.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false));
						ptpassword.setFont(new java.awt.Font("Dialog",1,20));
					}
					{
						pnimagen = new JPanelIcon();
						pninicio.add(getPnimagenx());
						pnimagen.setBounds(139, 19, 515, 198);
						pnimagen.setRutaImagen("/imagen/logo1.jpg");
					}
				}
			}
			pack();
			this.setSize(820, 441);
		} catch (Exception e) {
		    //add your error handling code here
			e.printStackTrace();
		}
	}

	public JPanel getPndatos() {
		return pndatos;
	}

	public JPanel getPninicio() {
		return pninicio;
	}

	public JPanel getPnimagen() {
		return pnimagen;
	}

	public JLabel getLblpassword() {
		return lblpassword;
	}

	public TxtEscribirLetrasEspaciosNumeros getTxtid() {
		return txtid;
	}

	public JLabel getLblid() {
		return lblid;
	}

	public BtSacfre getBtentrar() {
		return btentrar;
	}

	public BtSacfre getBtcancelar() {
		return btcancelar;
	}
	
	public JPasswordField getPtpassword() {
		return ptpassword;
	}

	public void AgregarEscuchadores(ActionListener actionlistener){
		this.btentrar.addActionListener(actionlistener);
		this.btcancelar.addActionListener(actionlistener);
	}
	
	public JPanelIcon getPnimagenx() {
		return pnimagen;
	}

	public JOptionPane getMensaje() {
		return mensaje;
	}
	
}
